from django.db import models

class category(models.Model):
    _id = models.AutoField(primary_key = True, blank = True)
    name = models.CharField(max_length = 128, unique = True)
    parents = models.IntegerField(blank = True, default = 1)
    state = models.BooleanField(default = True)
    priority = models.IntegerField(blank = True, default = 100)
    
class contract(models.Model):
    _id = models.AutoField(primary_key = True, blank = True)
    categoryId = models.IntegerField()
    title = models.CharField(max_length = 256, unique = True)
    content = models.CharField(max_length = 2048)
    publishAt = models.DateField(blank = True, auto_now_add = True)
    state = models.BooleanField(blank = True, default = True)
